#pragma once
#ifndef xWorkingPool_h__
#define xWorkingPool_h__
#include "../inc/xType.h"
namespace Sky
{
namespace NThreads
{

typedef struct _xTask xTask;

typedef TBool (*FunOnDoTask)(xTask* work,HANDLE event);
typedef TBool (*FunOnDoTaskResult)(xTask* work);
typedef TBool (*FunOnWorkDone)(xTask* work);
typedef struct _xTask
{

	FunOnDoTask			onDoTask;
	FunOnDoTaskResult	onDoTaskResult;
	FunOnWorkDone		onTaskDone;
	TVoid*				userData;
}xTask;

typedef struct _xWorkPool xWorkPool;

xWorkPool* xWorkPool_Create(TInt workers_number);
TVoid xWorkPool_Delete(xWorkPool* pool);
TBool xWorkPool_Assign(xWorkPool* pool,xTask* task);
TBool xWorkPool_CheckJobDone(xWorkPool*pool);
}
}
#endif // xWorkingPool_h__